<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 
  <canvas id="canvas" height="600" width="700"></canvas>
  <script>
    const canvas = document.getElementById('canvas')
    const ctx = canvas.getContext('2d')

    ctx.font = '50px Verdana' // 为了展示方便，这里为文本添加了样式，使用 .font 设置样式会在后边讲到
    //描边文本
    // ctx.strokeText('Hello Canvas!', 180, 320, 400)

    //填充文本
    ctx.fillText('Hello Canvas!', 180, 320, 400)
  </script> -->
  <canvas id="canvas" height="600" width="700"></canvas>
  <script>
    const canvas = document.getElementById('canvas')
    const ctx = canvas.getContext('2d')

    ctx.font = '50px Verdana' // 为了展示方便，这里为文本添加了样式，使用 .font 设置样式会在后边讲到
    ctx.strokeText('Hello Canvas!', 180, 320, 400)
  </script>
</body>

</html>